public class Main {
    public static void main(String[] args) {
        Originator myOriginator = new Originator("黄前久美子",3);
        Memento oldState1=myOriginator.createMemento();

        myOriginator.setCurrentName("久石奏");
        myOriginator.setCurrentNo(4);
        Memento oldState2=myOriginator.createMemento();

        myOriginator.setCurrentName("多崎作");
        myOriginator.setCurrentNo(50);
        System.out.println("最新记录：\t"+myOriginator.toString());

        myOriginator.restoreStateByMemento(oldState2);
        System.out.println("读取上条记录：\t"+myOriginator.toString());

        myOriginator.restoreStateByMemento(oldState1);
        System.out.println("读取上上条记录：\t"+myOriginator.toString());
    }
}